import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

var router = new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      component: () => import('./views/Home'),
      children: [

      ]
    }
  ]
})

router.beforeEach((to, from, next) => {
    window.scroll(0, 0);
    var query = to.query;
    if (query.token) {
        window.sessionStorage.setItem('token',query.token)
    }

    // if(to.path === '/'){
    //   router.replace('/info')
    // }
    next();
});

export default router
